package cn.edu.cdu.farmdeal.service;



import cn.edu.cdu.farmdeal.domain.QqLogin;
import org.springframework.stereotype.Service;

import java.io.UnsupportedEncodingException;

/**
 * @author tupeng
 * @date 2019/12/08
 * @Description TODO
 **/
@Service
public interface AuthService {
    /**
     * 根据code获得taken
     * @param code
     * @return token
     */
    public abstract String getAccessToken(String code);

    /**
     * 根据taken获取open_Id
     * @param accessToken
     * @return open_id
     */
    public abstract String getOpenId(String accessToken);

    /**
     * 刷新taken
     * @param code
     * @return
     */
    public abstract String refreshToken(String code);

    /**
     *
     * 拼接url
     * @return
     * @throws UnsupportedEncodingException
     */
    public abstract String getAuthorizationUrl() throws UnsupportedEncodingException;

    /**
     *
     * 获得用户信息
     * @param accessToken
     * @param openId
     * @return
     */
    public abstract QqLogin getUserInfo(String accessToken, String openId);

}
